import { http } from '@/utils/http'

/** 查询老师题库 */
export const getTeacherListApi = (params: any) => {
  return http.get<any>('/edu/student/repo/list', params)
}

/* 查询公共题库 */
export function getPublicListApi(params?: any) {
  return http.get<any>('/edu/student/repo/listPublic', params)
}

/* 查询 老师题库的题型及题目数量 */
export function getTeacherQuCountApi(params: any) {
  return http.get<any>(`/edu/student/repo/queryById`, params)
}

/* 查询 公共题库的题型及题目数量 */
export function getPublicQuCountApi(params: any) {
  return http.get<any>(`/edu/student/repo/publicQueryById`, params)
}

/* 查询 最近练习详情 */
export function getRecentInfoApi(params: any) {
  return http.get<any>(`/edu/app/student/statForPracticeMode`, params)
}

/* 查询 所有题目数据(🈚️进度模式) */
export function getTopicsOfNoProgressApi(params?: any) {
  return http.get<any>('/edu/student/qu/query', params)
}

/* 查询 所有题目数据(🈶️进度模式) */
export function getTopicsOfHaveProgressApi(params: any) {
  return http.get<any>('/edu/studentQuMistakes/practice', params)
}

/* 查询 所有题目数据(错题模式) */
export function getTopicsOfErrorApi(params?: any) {
  return http.get<any>('/edu/studentQuMistakes/list', params)
}

/* 结束训练 - 非错题模式 */
export function endPracticeApi(data: any) {
  return http.post<void>('/edu/studentQuMistakes/batch', data)
}

/* 结束训练 - 错题模式 */
export function endErrorPracticeApi(data: any) {
  return http.put<void>('/edu/studentQuMistakes', data)
}

/* 结束训练时调取 - 保存 总题数、正确题数、错误题数、正确率、当前题id */
export function topicsInfoApi(data: any) {
  return http.post<void>('/edu/studentPracticeModeStats', data)
}
